/*
 * @file    :drv_flash.h
 * @author  :LingFengLu
 * @date    :2023-06-06
 */

#ifndef _DRV_FLASH_H_
#define _DRV_FLASH_H_
#include "global.h"
//Constant definition    宏定义
#define FLASH_START_ADDR             (0x10098800)
#define FLASH_END_ADDR               (0x100BE800 -0x01) //156k
#define FLASH_SIZE_PER_PAGE          (0x800)
#define FLASH_ERASE_VALUE            (0x00)
//Type definition    类型定义

//Function declaration    函数申明
void DrvFlash_Init(void);
uint DrvFlash_Write
(
    uint32 u32_Addr,
    uint8 * u8p_Data,
    uint32 u32_Len
);
uint DrvFlash_Read
(
    uint32 u32_Addr,
    uint8 * u8p_Data,
    uint32 u32_Len
);
uint DrvFlash_ErasePage
(
  uint32 u32_Addr
);
uint DrvFlash_FileLoad
(
    uint32 u32_FileID,
    uint8 *u8p_Data,
    uint32 u32_Length
);
uint  DrvFlash_FileWrite
( 
    uint32 u32_FileID,
    uint8 *u8p_Data,
    uint32 u32_Length
);
uint DrvFlash_DeleteFile
(
    uint32 u32_FileID
);
void NVM_TEST(void) ;
//Golbal variable declaration   全局变量申明










#endif

